package mapping

import (
	"maya-service/model"
	"maya-service/model/entity"
)

// UserRecordsEntityToDto entity data transfer
func UserRecordsEntityToDto(userRecords []*entity.UserRecord) []*model.UserRecordInfo {
	out := make([]*model.UserRecordInfo, 0, len(userRecords))
	for _, c := range userRecords {
		out = append(out, UserRecordEntityToDto(c))
	}
	return out
}

// UserRecordEntityToDto entity data transfer
func UserRecordEntityToDto(e *entity.UserRecord) *model.UserRecordInfo {
	return &model.UserRecordInfo{

		Id: e.Id,

		UserId: e.UserId,

		CustomData: e.CustomData,

		UnlockNum:  e.UnlockNum,
		Supervisor: e.Supervisor,

		NickName: e.NickName,
		Phone:    e.Phone,

		UserMoney: e.UserMoney,

		WithdrawMoney: e.WithdrawMoney,

		WxwebOpenid: e.WxwebOpenid,

		CreatedAt: e.CreatedAt,

		UpdatedAt: e.UpdatedAt,
	}
}
